package com.smartrm.globalinfrcore.idgenerator.impl;


import com.smartrm.globalinfrcore.idgenerator.UniqueIdGenerator;
import com.smartrm.globalinfrcore.idgenerator.impl.mapper.UniqueIdMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/*
 * @author: houhong
 * @description:
 */
@Service
public class UniqueIdGeneratorImpl implements UniqueIdGenerator {

    @Autowired
    UniqueIdMapper mapper;

    @Override
    public long next() {
        UniqueIdDo id = new UniqueIdDo();
        mapper.nextUniqueId(id);
        return id.getId();
    }
}
